<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="layout" content="main" />
    <title>New Vacation for ${person.name} ${person.lastName}</title>         
  </head>
  <body>
    <div class="nav">
      <span class="menuButton"><a class="home" href="${resource(dir:'')}">Home</a></span>
      <span class="menuButton"><g:link class="list" action="list">Vacation List</g:link></span>
    </div>
    <div class="body">
      <h1>New Vacation for ${person.name} ${person.lastName}</h1>

      <g:if test="${flash.message}">
        <div class="message">${flash.message}</div>
      </g:if>

      <g:hasErrors bean="${vacationInstance}">
        <div class="errors">
          <g:renderErrors bean="${vacationInstance}" as="list" />
        </div>
      </g:hasErrors>

      <g:form action="saveVacation" method="post" >
	<input style="display:none;" type="text" name="personId" value="${person.id}"/>
        <div class="dialog">
          <table>
            <tbody>
              
              <tr class="prop">
                <td valign="top" class="name">
                  <label for="startDate">Start Date:</label>
                </td>
                <td valign="top" class="value ${hasErrors(bean:vacationInstance,field:'startDate','errors')}">
		  <input class="datepicker-field" id="vacation-start-datepicker" type="text" name="startDate" value=""/>
                </td>
              </tr> 
              
              <tr class="prop">
                <td valign="top" class="name">
                  <label for="endDate">End Date:</label>
                </td>
                <td valign="top" class="value ${hasErrors(bean:vacationInstance,field:'endDate','errors')}">
		  <input class="datepicker-field" id="vacation-end-datepicker" type="text" name="endDate" value=""/>
                </td>
              </tr> 
              
              <tr class="prop">
                <td valign="top" class="name">
                  <label for="description">Description:</label>
                </td>
                <td valign="top" class="value ${hasErrors(bean:vacationInstance,field:'description','errors')}">
                  <input type="text" id="description" name="description" value="${fieldValue(bean:vacationInstance,field:'description')}"/>
                </td>
              </tr> 
              
            </tbody>
          </table>
        </div>
        <div class="buttons">
          <span class="button">
	    <input class="save" type="submit" value="Create" />
	  </span>
        </div>
      </g:form>
    </div>
  </body>
</html>
